package cn.net.xyan.blossom.webUI.utils

import com.vaadin.server.Page
import com.vaadin.shared.Position
import com.vaadin.ui.Notification
import com.vaadin.ui.themes.ValoTheme



fun String.notification(title:String = "通知",type: Notification.Type =  Notification.Type.HUMANIZED_MESSAGE){
    Notification(title, this, type).apply {
        styleName += " " + ValoTheme.NOTIFICATION_CLOSABLE
        position = Position.TOP_CENTER
        show(Page.getCurrent())
    }
}